import pandas as pd
import os

df_list = []

for fname in os.listdir('.'):
    if fname.endswith('.xlsx'):
        df_list.append(pd.read_excel(fname))

df_all = pd.concat(df_list)
def complete_date(df_sub):
    return df_sub.Series({
        "总和": round(df_sub['统计列'].sum(), 2),
        "平均数": round(df_sub['统计列'].mean(), 2),
        "最小值": round(df_sub['统计列'].min(), 2),
        "最大值": round(df_sub['统计列'].max(), 2),
    })
# 将统计结果输出到文件中
df_all.groupby('列名').apply(complete_date).to_excel('汇总统计.xlsx', index=False)